package cn.itcast.day05.demo02;

public class Demo06StringPractise {
    public static void main(String[] args) {
        int[] array = {1, 2, 3};
        String s = fromArrayToString(array);
        System.out.println(s);
    }

    public static String fromArrayToString(int[] array) {
        String str = "[";
        for (int i = 0; i < array.length; i++) {
            if(i!=array.length-1){
                str += "word" + array[i]+"#";
            }else{
                str += "word" + array[i];
            }
        }
        str = str + "]";
        return str;
    }
}
